/*
1.编程实现以下类。
People作为公共基类，包含string类型成员变量 m_name, int类型成员变量m_age;实现带参构造函数。
Teacher类由People类派生， Student类由People类派生， Doctor类由Teacher类、Student类派生。
People constructor ...
Teacher constructor ...
Studnet constructor ...
Doctor constructor ...
Doctor destrory ...
Student destrory ...
Teacher destrory ...
People destrory ...
 *
 */
#include <iostream>
using namespace std;

class People{
	protected:
		string m_name;
		int m_age;
	public:
		People(const string& str, int age): m_name(str), m_age(age){
			cout << "People constructor ..." << endl;
		}
	    virtual ~People(){
			cout << "People destrory ..." << endl;
		}
};

class Teacher : virtual public People{
	protected:
		//所带课程
		string m_project;
	public:
		Teacher(const string& str, int age, const string& project): People(str, age), m_project(project){	
			cout << "Teacher constructor ..." << endl;
		}
		~Teacher(){
			cout << "Teacher destrory ..." << endl;	
		}
};


class Student : virtual public People{
	protected:
		//分数
		int m_score;
	public:
		Student(const string& str, int age, int score): People(str, age), m_score(score){	
			cout << "Studnet constructor ..." << endl;
		}
		~Student(){
			cout << "Student destrory ..." << endl;	
		}
};

class Doctor : public Teacher, public Student{
	protected:
		int m_salary;
	public:
		Doctor(const string& str, int age, const string& project, int score, int salary): People(str, age), 
		Teacher(str, age, project), Student(str, age, score), m_salary(salary){
			cout << "Doctor constructor ..." << endl;
		}
		~Doctor(){
			cout << "Doctor destrory ..." << endl;	
		}

};

int main(){
	
	Doctor d("chengaj", 29, "disease", 100, 2000000);
	return 0;
}
